Skip to content

fix: repair cross-package bugs so all tests pass - #89

Open
stooit wants to merge 1 commit into
mainfrom
quantcode/e2e-tier3-2302-1784996681
Open

fix: repair cross-package bugs so all tests pass#89
stooit wants to merge 1 commit into
mainfrom
quantcode/e2e-tier3-2302-1784996681

Conversation

@stooit

@stooit stooit commented Jul 25, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes all failing tests and the real type error across the monorepo. 13/13 tests now pass in packages/ui, packages/utils, and apps/web; tsc --noEmit is clean (aside from the pre-existing bun:test module-resolution errors, which are an environment quirk unrelated to these bugs).

Bugs fixed

  1. Stale hook import (apps/web/src/lib/api.ts) — the file imported the renamed/removed useThrottle from @e2e/utils, causing TS2305 and breaking apps/web/test/api.test.ts. Switched to the correct useDebounce and kept the useSearchDebounce public alias that the test asserts.
  2. Icon-only Button missing accessible name (packages/ui/src/components/Button/Button.tsx)aria-label was not forwarded, so an icon-only button had no accessible name (WCAG 4.1.2). Now forwards aria-label; the no-label case still renders (with a dev warning) as the test expects.
  3. Ambiguous date format (packages/utils/src/format/date.ts)formatDate produced zero-padded, ambiguous output (01/03/2024) so "day 1" could be confused with "month 1". Switched to an en-AU day-first short style so the day is non-zero-padded and unambiguous.

Verification

  • packages/ui: 6 pass / 0 fail
  • packages/utils: 5 pass / 0 fail
  • apps/web: 2 pass / 0 fail
  • ./node_modules/.bin/tsc --noEmit: no errors except the pre-existing bun:test env resolution errors

Constraints honoured

  • No test files modified
  • No new dependencies added
  • Only 3 source files changed (7 insertions, 10 deletions)

Assumptions

  • The pre-existing Cannot find module 'bun:test' tsc errors are an environment/type-resolution quirk, not part of the assigned bugs, so they were left untouched.
  • The intended public hook name is useSearchDebounce (as asserted by the test), backed by the useDebounce implementation.

- fix stale useThrottle import in apps/web/src/lib/api.ts to use
  useDebounce, keeping the useSearchDebounce public alias intact
- forward aria-label on icon-only Button for an accessible name (WCAG 4.1.2)
- use en-AU dateStyle:short in formatDate so day 1 is not confused with
  month 1 (day-first, non-ambiguous ordering)

No test files modified, no new dependencies. All 13 tests pass across
packages/ui, packages/utils, apps/web; tsc clean (except pre-existing
bun:test env resolution errors).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant